home *** CD-ROM | disk | FTP | other *** search
- // TestDlg.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "TestDlg.h"
- #include "TestChildWnd.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestDlg dialog
-
-
- CTestDlg::CTestDlg(VIEW view, RECTANGLE *wvp, char *clut, CWnd* pParent /*=NULL*/)
- : CDialog(CTestDlg::IDD, pParent), m_View(view), m_pWvpRect(wvp),
- m_pszClut(clut), m_pTestChildWnd(0)
- {
- //{{AFX_DATA_INIT(CTestDlg)
- //}}AFX_DATA_INIT
- }
-
-
- CTestDlg::~CTestDlg()
- {
- if(m_pTestChildWnd)
- delete m_pTestChildWnd;
- }
-
- void CTestDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTestDlg)
- DDX_Control(pDX, IDPAUSE, m_ContPause);
- DDX_Control(pDX, IDC_SPEED, m_UpdRateSlider);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
- //{{AFX_MSG_MAP(CTestDlg)
- ON_BN_CLICKED(IDGO, OnGo)
- ON_BN_CLICKED(IDSTOP, OnStop)
- ON_BN_CLICKED(IDPAUSE, OnPause)
- ON_WM_VSCROLL()
- ON_WM_CANCELMODE()
- ON_NOTIFY(NM_CLICK, IDC_SPEED, OnSliderClick )
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CTestDlg message handlers
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- BOOL CTestDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_pTestChildWnd = new CTestChildWnd(IDC_RUNAREA,m_View,m_pszClut,this);
- m_pTestChildWnd->Create(IDD_TESTWINDOW,this);
-
- int nRates = m_pTestChildWnd->GetNumUpdateRates();
-
- m_UpdRateSlider.SetRange(0, nRates);
- m_UpdRateSlider.SetPos(m_pTestChildWnd->GetDefaultRate());
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- void CTestDlg::OnGo()
- {
- m_pTestChildWnd->StartTest();
- }
-
- void CTestDlg::OnStop()
- {
- m_pTestChildWnd->StopTest();
- }
-
- void CTestDlg::OnPause()
- {
- m_pTestChildWnd->PauseTest();
- if(m_pTestChildWnd->IsPaused())
- m_ContPause.SetWindowText("Cont");
- else
- m_ContPause.SetWindowText("Pause");
- }
-
- void CTestDlg::OnSliderClick(NMHDR * pNotifyStruct, LRESULT * pResult)
- {
- m_pTestChildWnd->SetUpdateRate(m_UpdRateSlider.GetPos());
- *pResult = 0;
- }
-
-
-